import java.util.Calendar;
import java.util.Date;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-12
 * Time:10:34
 */
public class main {
    public static void main(String[] args) {
        int a=222222200;
        char b=42;
        String w="汤琦";
        String wf=String.format(w+"有%,d万的钱需要还%c年",a,b);
        System.out.println(wf);
        System.out.println(String.format("%tc",new Date()));
        System.out.println(String.format("%tr",new Date()));
        Date www=new Date();
        System.out.println(String.format("%tA,%<tB %<td",www));
        System.out.println("=================以下是操作时间================");
        Calendar cal= Calendar.getInstance();
        cal.set(2002,11,13,18,25);
        System.out.println("now time:"+cal.getTime());
        long day1=cal.getTimeInMillis();
        day1+=1000*60*60;
        cal.setTimeInMillis(day1);
        System.out.println("new hour:"+cal.get(cal.WEEK_OF_MONTH));
        cal.add(cal.DATE,35);
        System.out.println("add 35 days:"+ cal.getTime());
        //只添加日期，月份不动
        cal.roll(cal.DATE,3);
        System.out.println("roll 35 days:"+cal.getTime());
        cal.set(cal.DATE,1);
        System.out.println("set to 1:"+cal.getTime());
    }
}
